package com.usian.scheduled;

import com.usian.service.UserService;
import com.usian.service.impl.UserServiceImpl;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class MyJob implements Job {

    @Autowired
    private UserService userService;

    private final static Logger logger = LoggerFactory.getLogger(UserServiceImpl.class);

    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        logger.info("5秒一次");
        userService.sayHello();
    }
}
